package com.ssh;

public class JudgeSquareSum_633 {
	public boolean judgeSquareSum(int c) {
        int lo = 0, hi = (int)Math.sqrt(c);
        while (lo <= hi) {
        	if (lo*lo + hi*hi == c) {
        		return true;
        	}else if (lo*lo + hi*hi <= c) {
        		lo++;
        	}else {
        		hi--;
        	}
        }
        return false;
    }
}
